package test.yzx.pproject.util;


import android.support.v7.widget.RecyclerView;
import android.util.SparseArray;
import android.view.View;

public abstract class BaseRecyclerAdapter extends RecyclerView.Adapter<BaseRecyclerAdapter.BaseViewHolder>{

    /*  */

    protected class BaseViewHolder extends RecyclerView.ViewHolder{
        private SparseArray<View> viewArray = new SparseArray<>();
        public View getView(int id){
            View result = viewArray.get(id);
            if(result != null) return result;
            View view = itemView.findViewById(id);
            if(view != null)
                viewArray.put(id,view);
            return view;
        }
        public BaseViewHolder(View itemView) {
            super(itemView);
        }
    }

}
